<#assign object = doc.object>
package ${object.package}.service.http;

import ${object.package}.service.base.${object.name}ServletBase;

/**
* Dispatcher for http/JSON requests between client and server.
* This servlet will deploy all possible actions on your data (for example delete) without any restrictions.
* You may not want that, so either modify the web.xml and add security there ... [TODO: how?] or add more extensive
* security in this class.
*/ 
public class ${object.name}Servlet extends ${object.name}ServletBase {

//Example of a simple security override
/*
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		try {
			${object.name}Service service = ServiceFactory.${object.name?uncap_first}Service();
			${object.name}ServiceJSON serviceJSON = ServiceFactory.${object.name?uncap_first}ServiceJSON();
			if (req.getParameter("action").equalsIgnoreCase("remove")) {
				${object.name} ${object.name?uncap_first} = serviceJSON.fromJson(${object.name}Util.getJSONValue(req));
				//just an example...
				if (RandomUtils.nextBoolean())
					service.delete(${object.name?uncap_first});
			} else {
				super.doGet(req, resp);
			}
		} catch (Exception e) {
			l.log(Level.SEVERE, "I failed to process a JSON request: " + req.getParameter("action"), e);
			throw new ServletException("I failed to process a JSON request: " + req.getParameter("action"), e);
		}
	}
*/
}
